Memory devices are widely used in computers and many electronic items to store information. A memory device usually has numerous memory cells. The memory device performs a write operation to store information in the memory cells, a read operation to read the stored information, and an erase operation to erase information (e.g., obsolete information) from some or all of the memory cells. During these operations, an event such as a leakage of current near the memory cells may occur. Such an event may reduce the efficiency of some operations (e.g., read and write operations) of the memory device. However, for other operations (e.g., erase operations) of the memory device, such an event may be useful. Thus, designing a memory device and operating it to balance the effect of an event such as leakage current may pose a challenge.